/*
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2025-04-22 16:32:31
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2025-04-25 15:48:19
 * @FilePath: \react-demo\src\pages\Home\components\homeMsg.jsx
 */
import React, { Component } from "react";
import {
  Link,
  NavLink,
  Outlet,
  Routes,
  Route,
  Redirect,
} from "react-router-dom";
import MsgDetail from "./msgDetail";

export default class homeMsg extends Component {
  state = {
    msgList: [
      { id: 1, title: "消息1", content: "好消息!" },
      { id: 2, title: "消息2", content: "好消息!!" },
      { id: 3, title: "消息3", content: "好消息!!!" },
    ],
  };

  render() {
    return (
      <div>
        <ul>
          {this.state.msgList.map((obj) => {
            return (
              <li key={obj.id}>
                <Link to={`/home/msgs/msgDetail${obj.id}`}>{obj.title}</Link>
              </li>
            );
          })}
          {/* <Routes>
            <Route path="/msgDetail/:id" element={<MsgDetail />}></Route>
          </Routes> */}
        </ul>
      </div>
    );
  }
}
